package com.flashcash.solu.harvester.def;

import android.Manifest;

/**
 * 需要搜集的信息的种类
 * */
public enum InfoType {
    CONTACT,
//    CALL_LOG,
    //SMS_LOG,
    LOCATION,
    PERMISSION,
    MACHINE_TYPE,
//    BEHAVIOR_MSG,
    CRASH_MSG;

    public String getUploadAck(){
        return this.name()+"_ACK";
    }

    public static String toPermission(InfoType type){
        switch (type){
            case CONTACT:
                return Manifest.permission.READ_CONTACTS;
//            case CALL_LOG:
//                return Manifest.permission.READ_CALL_LOG;
//            case SMS_LOG:
//                return Manifest.permission.READ_SMS;
            case LOCATION:
                return Manifest.permission.ACCESS_COARSE_LOCATION;
            default:
                return null;
        }
    }
//
//    public static InfoType fromPermission(String permission){
//        switch (permission){
//            case Manifest.permission.READ_CONTACTS:
//                return CONTACT;
//            case Manifest.permission.READ_CALL_LOG:
//                return CALL_LOG;
//            case Manifest.permission.READ_SMS:
//                return SMS_LOG;
//            case Manifest.permission.ACCESS_COARSE_LOCATION:
//            case Manifest.permission.ACCESS_FINE_LOCATION:
//                return LOCATION;
////            case Manifest.permission.READ_PHONE_STATE:
////                return MACHINE_TYPE;
//        }
//        throw new IllegalArgumentException(permission);
//    }
}
